
package org.dromara.system.api.feign;

/**
 * @author: zhou shuai
 * @date: 2024/10/5 17:10
 * @version: v1
 */

import org.dromara.common.core.domain.R;
import org.dromara.system.api.feign.fallback.SystemRoleFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

import static org.dromara.common.core.constant.ServerNameConstants.SYSTEM_SERVER_NAME;

@FeignClient(contextId = "system-role-api", name = SYSTEM_SERVER_NAME, fallbackFactory = SystemRoleFallBack.class)
public interface SystemRoleClient {

    /**
     * 根据角色 ID 列表查询角色名称映射关系
     *
     * @param roleIds 角色 ID 列表
     * @return Map，其中 key 为角色 ID，value 为对应的角色名称
     */
    @GetMapping(value = "/api/system/role/roleName/byRoleIds")
    R<Map<Long, String>> selectRoleNamesByIds(@RequestParam("roleIds") List<Long> roleIds);

}
